home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
net
/
dnet_src.lha
/
dnet
/
amiga
/
lib
/
waitqueue.c
< prev
Wrap
C/C++ Source or Header
|
1989-11-05
|
669b
|
36 lines
/*
* WaitQueue.C
*/
#include "lib.h"
short
WaitQueue(_chan, skipior)
void *_chan;
IOSTD *skipior;
{
CHANN *chan = (CHANN *)_chan;
IOSTD *io;
short error = 0;
while (chan->queued > chan->qlen) { /* until done */
WaitPort(&chan->port); /* something */
io = (IOSTD *)GetMsg(&chan->port);
if (io->io_Message.mn_Node.ln_Type == NT_REPLYMSG) {
if (error == 0)
error = io->io_Error;
if (io != skipior) {
if (io->io_Length)
FreeMem(io->io_Data, io->io_Length);
FreeMem(io, sizeof(IOSTD));
}
--chan->queued;
} else {
AddTail(&chan->rdylist, (NODE *)io);
}
}
return(error);
}